from mycelery.main import app
from luffyapi.libs.smsronglian_sdk.SendMessage import send_message
import logging

logger = logging.getLogger('django')


@app.task(name='email')  # 将这个函数指定成一个任务
def send_sms(mobile, sms_code):
    res = send_message(mobile, (sms_code, 5), '1')
    if res.get('statusCode') != '000000':
        logger.error(f'{mobile} 短信发送失败')
    return 'send email task halou'
